/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.panomedic;

import com.panomedic.kernel.*;

import com.panomedic.log4j.Log4jPropertiesLoader;
import com.panomedic.log4j.LogCategories;
import com.panomedic.log4j.Logger;
import com.panomedic.utils.StringUtils;
import java.io.File;
import org.apache.log4j.PropertyConfigurator;

/**
 *
 * @author Yare
 */
public class Panomedic {

    static Logger logger = new Logger();

    public static void main(String[] args) {


        // Load log4j logger properties
        Log4jPropertiesLoader.loadProperties(Kernel.DEBUG);
//        PropertyConfigurator.configure(Constants.LOG_PROPERTIES_FILE);

        /** Log program properties */
        logProgramProperties();

        /** Start the application kernel */
        Kernel.Start();
    }

    private static void logProgramProperties(/*ArrayList<String> arguments*/) {
        // version number
        String firstLine = StringUtils.fromObjectArrayToString(new Object[]{"Starting ", Constants.APPLICATION_NAME, " ", Constants.APPLICATION_VERSION_NUMBER});
        logger.info(LogCategories.START, firstLine);


        // Java Virtual Machine Version
        logger.info( LogCategories.START, StringUtils.fromObjectArrayToString(new String[]{"Running in Java Virtual Machine ", System.getProperty("java.vm.version")}));

        // Application Arguments
//        logger.info(LogCategories.START, StringUtils.fromObjectArrayToString(new Object[] {"Arguments = ",arguments}));

        // DEBUG mode
        logger.info( LogCategories.START,StringUtils.fromObjectArrayToString(new Object[]{"Debug mode = ", Kernel.DEBUG}));

        // Execution path
        logger.info( LogCategories.START, StringUtils.fromObjectArrayToString(new String[]{"Execution path = ", new File("").getAbsolutePath()}));
//        try {
//
//            // Computer name
//            logger.info("Compucter name = " + java.net.InetAddress.getLocalHost().getHostName());
//        } catch (UnknownHostException ex) {
//            java.util.logging.Logger.getLogger(Panomedic.class.getName()).log(Level.SEVERE, null, ex);
//        }
    }

}

